<template>
  <div class="bg-w">
    <div class="container flex-al">
      <!-- <build-el-bread></build-el-bread> -->
      <buildElThreeList @handDetails="handDetails" :tableData="tableData"></buildElThreeList>
      <el-pagination
        v-margin-top="'30px'"
        background
        :page-size="pageSize"
        :current-page="pageNow"
        layout="prev, pager, next"
        @current-change="changePage"
        :total="total"
      ></el-pagination>
      <div v-margin-top="'30px'"></div>
    </div>
  </div>
</template>
<script>
import buildElBread from '@/components/build-el-bread'
import buildElThreeList from '@/components/build-el-three-list'
export default {
  components: {
    buildElBread,
    buildElThreeList,
  },
  data() {
    return {
      tableData: null,
      total: 0,
      pageSize: 6,
      pageNow: 1,
    }
  },
  async created() {
    await this.init(1)
  },
  methods: {
    handDetails(id, item) {
      console.log(item)
      if (item.pcJumpLink != null) {
        window.open(item.pcJumpLink)
      } else if (item.mobileJumpLink != null) {
        window.open(item.mobileJumpLink)
      } else {
        this.toPage(id)
      }
    },
    async init(page) {
      this.tableData = []
      let tableData = await this.api.selectNewsList8(page, this.pageSize)
      this.total = tableData.total
      this.tableData = tableData.list
      console.log('tableData', this.tableData)
    },
    changePage(e) {
      this.pageNow = e
      this.init(e)
    },
  },
}
</script>
<style lang="less" scoped>
html {
  background: #eee;
}
.build-active-promember-home {
  margin-bottom: 40px;
  .promember-home-box {
    display: flex;
  }
}
</style>
